Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHC 9.12 #151

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

GHC 9.12 #151

wants to merge 6 commits into from

Conversation

alanz
Copy link
Collaborator

@alanz alanz commented Nov 28, 2024

Update for GHC 9.12.1

@alanz alanz requested a review from zliu41 November 28, 2024 21:10
@alanz
Copy link
Collaborator Author

alanz commented Nov 28, 2024

This is a work in progress.
It needs cleaning up, I spread CPP everywhere, and broke the non-9.12.1 versions

And if I run

cabal test --test-option="-p /Fixity.hs/"

It fails with

    Expected type not found at the location specified in the refact file.
      Expected type: HsExpr (GhcPass 'Parsed)
      Location: tests/examples/Fixity.hs:1:21-27: inappropriate type

And that span is not in the new AST. So I am not sure if the refact test file needs updating

@alanz
Copy link
Collaborator Author

alanz commented Dec 5, 2024

I am down to 3 failures, all of which are perhaps "external"

    Use -p '/tests\/examples\/Structure7.hs/' to rerun this test only.

Caused by a spacing change in ghc-exactprint where there is now a new LHS counter initialisation to 0 not 1, to match nested logic, but gives off by one at the top level.

The next two are related to the refact hint input not matching the span, because the AST shows up differently. I am not sure how to deal with them

    Use -p '/tests\/examples\/Lambda37.hs/' to rerun this test only.
    Use -p '/tests\/examples\/EtaReduceLocalTypeSig.hs/' to rerun this test only.

@shayne-fletcher
Copy link

related hlint issue ndmitchell/hlint#1628

@alanz
Copy link
Collaborator Author

alanz commented Jan 20, 2025

I have updated ghc-exactprint at alanz/ghc-exactprint#139 which should enable this last bug to be fixed.

I will see about a release tomorrow.

@alanz
Copy link
Collaborator Author

alanz commented Jan 21, 2025

For this branch as it is it fails with the test Structure7.hs

    --- tests/examples/Structure7.hs.expected	2018-07-13 15:52:47.539128818 +0100
    +++ tests/examples/Structure7.hs.out	2025-01-21 18:53:33.707493381 +0000
    @@ -1,4 +1,4 @@
     foo x = yes x x where yes x y
    -                        | a = b
    -                        | c = d
    -                        | otherwise = e
    +                         | a = b
    +                         | c = d
    +                         | otherwise = e

    Use -p '/tests\/examples\/Structure7.hs/' to rerun this test only.

If I use ghc-exactprint at https://github.com/alanz/ghc-exactprint/tree/ghc-9.12-delta-ast then that test passes, but we get a failure on Structure8

FAIL (0.13s)
    --- tests/examples/Structure8.hs.expected	2018-07-13 15:52:47.539128818 +0100
    +++ tests/examples/Structure8.hs.out	2025-01-21 18:40:04.961810838 +0000
    @@ -1 +1 @@
    -foo x  = y
    +foo x | = y

    Use -p '/tests\/examples\/Structure8.hs/' to rerun this test only.

cabal test --test-option="-p /tests\/examples\/Structure8.hs/"

@alanz
Copy link
Collaborator Author

alanz commented Jan 21, 2025

And the Structure8 problem is fixed with alanz/ghc-exactprint@2265b71

I made a new ghc-exacprint release

This one should be good to go now. If/when the tests pass

@alanz
Copy link
Collaborator Author

alanz commented Jan 22, 2025

Ping @zliu41

Will you be able to take this over the line and make a release?

@zliu41
Copy link
Collaborator

zliu41 commented Jan 22, 2025

Thanks @alanz! I'm a bit tied up at the moment but will get to it as soon as I can. I'll see whether all old GHC versions still work - hopefully they still do, otherwise I can make a release that only supports 9.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants